package com.itheima_4;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class RFilectDemo {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InstantiationException, InvocationTargetException {
        Class aClass = Class.forName("com.itheima_4.Student");
        Method function4 = aClass.getMethod("function4", String.class);
        Student o = (Student) aClass.newInstance();
        Object o1 = function4.invoke(o, "zhangsan");
        System.out.println(o1);
    }
}
